package cn.edu.abtu.controller;

import cn.edu.abtu.service.AclPermissionService;
import cn.edu.abtu.vo.ResponseData;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;


@RestController
@RequestMapping("/eduacl/permission")
public class AclPermissionController {

    @Resource
    private AclPermissionService aclPermissionService;

    @ApiOperation(value = "获取全部菜单权限")
    @GetMapping("/indexAllPermission")
    public ResponseData indexAllPermission(){
        return aclPermissionService.queryAllMenu();
    }

    @ApiOperation(value = "根据权限菜单ID删除权限")
    @DeleteMapping("/delect/{id}")
    public ResponseData delete(@PathVariable String id){
        return aclPermissionService.delete(id);
    }

    @ApiOperation(value = "给角色分配权限")
    @PostMapping("/doAssign")
    public ResponseData doAssign(String roleId,String[] permissionIds){
        return aclPermissionService.doAssign(roleId,permissionIds);
    }


}

